# -*- coding: UTF-8 -*-

"""
    决策树文件操作工具
"""
class FileUtil:

    @staticmethod
    def readFile(file):
        dataSet = []
        labels = []
        fileRow = 0
        for line in open(file):
            if fileRow > 0:
                dataSet.append(line.strip('\n\r').split('\t'))
            else:
                labels = line.strip('\n\r').split('\t')
                fileRow = 1
        print("列名：")
        print(labels)
        print("训练集：")
        print(dataSet)
        return dataSet, labels
